<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="org.apache.commons.lang.time.DateFormatUtils"%>
<%@page import="org.springframework.util.CollectionUtils"%>
<%@page import="java.util.Collection"%>
<%@ include file="../common/common_include.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%
	AreaForm form = (AreaForm)request.getAttribute("command");
	String tab = form.getTab();
	UserInfo user = (UserInfo)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
	String siteid = user.getSiteId();
%>


<div id="childLayout" class="easyui-layout" data-options="fit:true">
	<div data-options="region:'west',split:true,maxWidth:220,collapsible:true,style:{borderWidth:2},onResize:function(){XF.LAYOUT.resizeWest();}" style="background: #f7f7f9;width:220px;" title=" ">
		 <div class="sidebar">
			<div id="sidebar" class="easyui-accordion" style="width:auto;height:auto;">
				<sec:authorize ifAllGranted="MANAGE_AREA">
					<div title="区域"  style="overflow:auto;padding:10px;">  
						<ul class="site-ul">
							<li class="site-li">
								<a s="addArea" href="javascript:XF.Area.addArea()"><span>新增区域</span></a>
							</li>
							<li class="site-li">
								<a s="listArea" href="javascript:XF.Area.listArea()"><span>区域管理</span></a>
							</li>
						</ul>
					</div>
			    </sec:authorize>
				<sec:authorize ifAnyGranted="MANAGE_MAP_SITE,MANAGE_MAP_CORE">
					<div title="围栏地图"  style="overflow:auto;padding:10px;">  
						<ul class="site-ul">
							<sec:authorize ifAllGranted="MANAGE_MAP_CORE">
								<li class="site-li">
									<a s="addAreaMap" href="javascript:XF.Area.addAreaMap()"><span>新增围栏地图</span></a>
								</li>
								<li class="site-li">
									<a s="listAllAreaMap" href="javascript:XF.Area.listAllAreaMap()"><span>围栏地图全局管理</span></a>
								</li>
								<li class="site-li">
									<a s="auditingAreaMap" href="javascript:XF.Area.auditingAreaMap()"><span>待审核围栏管理</span></a>
								</li>	
							</sec:authorize>
							<sec:authorize ifAllGranted="MANAGE_MAP_SITE">
								<li class="site-li">
									<a s="listAreaMap" href="javascript:XF.Area.listAreaMap('<%=siteid %>')"><span>站点围栏地图管理</span></a>
								</li>
							</sec:authorize>
						</ul>
					</div>
				</sec:authorize>
			</div> 
		</div>
	</div>
	<div id="areaCenter" class="siteCenter" data-options="region:'center'">
	</div>
</div>
<script type="text/javascript">
	$(function(){
		$('#childLayout').layout();
		XF.NAV.activeTab('"<%=tab%>"');
	    $('#sidebar').accordion({
	        animate:true
	    });	    
	});
</script>
</html>